package com.wust.smartcity.autotask.server.core.mq.consumer;

import com.alibaba.fastjson.JSONObject;
import com.wust.smartcity.autotask.server.core.service.impl.InitData4JobServiceImpl;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


/**
 * @author ：wust
 * @date ：Created in 2019/7/19 15:21
 * @description：管理员创建项目，子系统负责生成项目数据库
 * @version:
 */

@RabbitListener(
        containerFactory = "singleListenerContainer",
        bindings = @QueueBinding(
                value = @Queue(
                        value = "${spring.rabbitmq.initjob.queue.name}",
                        durable = "${spring.rabbitmq.initjob.queue.durable}"
                ),
                exchange = @Exchange(
                        value = "${spring.rabbitmq.initjob.exchange.name}",
                        durable = "${spring.rabbitmq.initjob.exchange.durable}",
                        type = "${spring.rabbitmq.initjob.exchange.type}",
                        ignoreDeclarationExceptions = "${spring.rabbitmq.initjob.exchange.ignoreDeclarationExceptions}"
                ),
                key = "${spring.rabbitmq.initjob.routing-key}"
        )
)
@Component
public class Consumer4InitJobQueue {
    @Autowired
    private InitData4JobServiceImpl initData4JobServiceImpl;

    @RabbitHandler
    public void process(JSONObject jsonObject) {
    }
}
